package com.vote.business.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.vote.common.annotation.Excel;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
@Accessors(chain = true)
public class UserVoteRecordVO {
    @Excel(name = "投票记录Id")
    private Long recordId;
    @Excel(name = "投票Id")// 记录ID
    private Long voteId;
    @Excel(name = "投票选项Id")// 投票ID
    private Long optionId;
    @Excel(name = "用户Id")// 选项ID
    private Long userId;
    @Excel(name = "用户昵称")// 用户ID
    private String nickName;
    @Excel(name = "投票标题")// 用户名（来自vote_user表）
    private String voteTitle;
    @Excel(name = "投票选项")// 投票标题（来自vote_info表）
    private String optionContent;     // 选项名称（来自vote_option表）
    /** 请求参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;
    /** 投票时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "投票时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date voteTime;   // 投票时间

    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }





}
